﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using VIA.Project.Domain.Devices;

namespace VIA.Project.Presentation.Converters
{
    public class CameraTypeToBoolConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            CameraSpecies cameraType = (CameraSpecies)value;
            int input = int.Parse(parameter.ToString());
            if ((int)cameraType == input)
            {
                return true;
            }
            return false;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            int param = int.Parse(parameter.ToString());
            CameraSpecies type = (CameraSpecies)int.Parse(parameter.ToString());
            bool b = (bool)value;
            if (b)
            {
                return type;
            }
            else
            {
                return CameraSpecies.Area;
            }
        }
    }
}
